﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiMaterialColor : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiMaterialColor(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiMaterialColor obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiMaterialColor()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiMaterialColor(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public static OdGiMaterialColor kNull
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiMaterialColor_kNull_get();
				OdGiMaterialColor result = (intPtr == IntPtr.Zero) ? null : new OdGiMaterialColor(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public OdGiMaterialColor() : this(GlobalsPINVOKE.new_OdGiMaterialColor(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setMethod(OdGiMaterialColor.Method method)
		{
			GlobalsPINVOKE.OdGiMaterialColor_setMethod(this.swigCPtr, (int)method);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setFactor(double factor)
		{
			GlobalsPINVOKE.OdGiMaterialColor_setFactor(this.swigCPtr, factor);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmEntityColor color()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiMaterialColor_color__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiMaterialColor.Method method()
		{
			OdGiMaterialColor.Method result = (OdGiMaterialColor.Method)GlobalsPINVOKE.OdGiMaterialColor_method(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double factor()
		{
			double result = GlobalsPINVOKE.OdGiMaterialColor_factor(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiMaterialColor other)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialColor_IsEqual(this.swigCPtr, OdGiMaterialColor.getCPtr(other));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGiMaterialColor other)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialColor_IsNotEqual(this.swigCPtr, OdGiMaterialColor.getCPtr(other));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColor(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiMaterialColor_setColor(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;

		public enum Method
		{
			kInherit,
			kOverride
		}
	}
}
